package cn.jiyun.service.impl;

import cn.jiyun.entity.XmDistributionWeather;
import cn.jiyun.mapper.XmDistributionWeatherMapper;
import cn.jiyun.service.IXmDistributionWeatherService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-22
 */
@Service
public class XmDistributionWeatherServiceImpl extends ServiceImpl<XmDistributionWeatherMapper, XmDistributionWeather> implements IXmDistributionWeatherService {

    @Override
    public Page findPage(Integer pageNum, Integer pageSize, XmDistributionWeather distributionWeather) {
        Page page = new Page(pageNum,pageSize);
        LambdaQueryWrapper<XmDistributionWeather> qr = new LambdaQueryWrapper<>();
        qr.like(distributionWeather.getApplyy()!=null,XmDistributionWeather::getApplyy,distributionWeather.getApplyy());
        qr.eq(distributionWeather.getWeatherr()!=null&distributionWeather.getWeatherr()!="",XmDistributionWeather::getWeatherr,distributionWeather.getWeatherr());
        qr.like(distributionWeather.getMsg()!=null,XmDistributionWeather::getMsg,distributionWeather.getMsg());
        qr.eq(distributionWeather.getStatus()!=null,XmDistributionWeather::getStatus,distributionWeather.getStatus());
        return baseMapper.selectPage(page,qr);
    }
}
